Hi All, I have one main folder, inside that folder, many folders are there and inside each folder there is one Module. I want to run DXL Script on the main folder through which, I want to open all the folder one by one and the inside module present in the respective folder, and want to fetch the some attribute value from the Module. Anyone can guide me in opening the folder and inside the main folder and through DXL Script. Thank you in advance. Regards, Ejaz saquibac - Wed Oct 25 07:43:06 EDT 2017 |
Re: Opening of Folder/Module Inside the Folder
void processModule(Item iSubItem){
//Module m = read(fullName(iSubItem), false);
//something...
}
void recurse(Item iFolder){
Item iSubItem;
for iSubItem in folder(iFolder) do{
if(type(iSubItem) == "Folder" || type(iSubItem) == "Project"){
recurse(iSubItem);
}else if(type(iSubItem) == "Formal"){
processModule(iSubItem);
}
}
}
Item iStart = item("/Path/To/Start");
recurse(iStart);
Try something like this |
Re: Opening of Folder/Module Inside the Folder O.Wilkop - Wed Oct 25 07:55:20 EDT 2017
void processModule(Item iSubItem){
//Module m = read(fullName(iSubItem), false);
//something...
}
void recurse(Item iFolder){
Item iSubItem;
for iSubItem in folder(iFolder) do{
if(type(iSubItem) == "Folder" || type(iSubItem) == "Project"){
recurse(iSubItem);
}else if(type(iSubItem) == "Formal"){
processModule(iSubItem);
}
}
}
Item iStart = item("/Path/To/Start");
recurse(iStart);
Try something like this Hi Wilkop, Thank you for the reply. I am getting the following error while running the code. -R-E- DXL: <Line:8> null Item parameter was passed into argument position 1 Backtrace: <Line:18> -I- DXL: execution halted Please help in that. Thank you in advance. Regards, Ejaz |
Re: Opening of Folder/Module Inside the Folder saquibac - Wed Oct 25 22:34:12 EDT 2017 Hi Wilkop, Thank you for the reply. I am getting the following error while running the code. -R-E- DXL: <Line:8> null Item parameter was passed into argument position 1 Backtrace: <Line:18> -I- DXL: execution halted Please help in that. Thank you in advance. Regards, Ejaz The code presented is recursive, it should go through all the subfolders, and their subfolders and so on. Try it. Your question is quite common in this forum, you might also find older discussion with the search. |
Re: Opening of Folder/Module Inside the Folder PekkaMakinen - Thu Oct 26 02:55:53 EDT 2017 The code presented is recursive, it should go through all the subfolders, and their subfolders and so on. Try it. Your question is quite common in this forum, you might also find older discussion with the search. Hi Pekka and Wilkop, Thank you for the reply, I understood. Could you please guide me for opening the modules through DXL Script without opening the Module. Thank you in advance. Regards, Ejaz |